<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="css/login.css"/>
    <title>忘记密码-确认账户</title>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var userInfo =null;
            $("[name='next1']").click(function () {
                var username = $("[name='username']").val();
                var yanzheng = $("[name='yzm']").val();
                if (yanzheng != 2399) {
                    location.href = "index.html";
                }
                $.get("user/renew",
                    {
                        "username": username
                    },
                    function (rs) {
                        userInfo = rs.result;

                        if (userInfo == null) {
                            alert("验证失败")
                            location.href = "index.html";

                        }else { alert("验证成功");}
                        alert(userInfo);
                        if(userInfo.number!=null){
                            $("#shoujihao").text("验证码已经发送到手机号"+userInfo.number);
                        }
                        else {
                            $("#shoujihao").text("验证码已经发送到邮箱"+userInfo.email);
                        }
                        $("#yhm").text(userInfo.username);
                        $("#nihaoya").text("你的用户名是"+userInfo.username);
                    });
            });
            $("#huoqu").click(function () {
                alert("获取成功你的验证码为666666")

            });
            $("[name='next2']").click(function () {

                var jihuo=$("[name='jihuo']").val();
                if (jihuo!="666666"){
                    alert("验证失败");
                    location.href = "password.html";
                }alert("验证成功")

            });
            $("[name='next3']").click(function () {
                var password=$("[name='new']").val();
                var password1=$("[name='new1']").val();
                var username = $("[name='username']").val();
                var email = userInfo.email;
                var number = userInfo.number;
                if (password==password1){
                    $.get("user/mima",
                        {
                            "email":email,
                            "number":number,
                            "username":username,
                            "password":password
                        },
                        function (rs) {
                            var mess=rs.result;
                            alert(mess);
                        });
                }
            });

        });


    </script>
</head>
<body>
<div class="header">
    <div class="mainwarp">
        <div class="logo"><a href="index.html"><img src="images/log.png"/></a></div>
        <div class="welcome">重置密码</div>
        <div class="headerright">
            <a href="login.html">个人登录 </a>
            <span>|</span>
            <a href="index.html">返回首页</a>
        </div>
    </div>
</div>
<div class="passdBox">
    <div class="passpart1">
        <div class="TitleNotice">忘记密码了？根据收到的激活码进行验证身份，通过验证后重置密码，您就可以登录了。</div>
        <div class="StepsBox">
            <div id="step_div_1" class="Step Active stepfirst">
                <span class="StepNo">1</span>
                <span class="StepName">确认账户</span>
            </div>
            <div id="step_div_2" class="Step">
                <span class="StepNo">2</span>
                <span class="StepName">安全认证</span>
            </div>
            <div id="step_div_3" class="Step">
                <span class="StepNo">3</span>
                <span class="StepName">重置密码</span>
            </div>
            <div id="step_div_4" class="Step steplast">
                <span class="StepNo"></span>
                <span class="StepName">完成</span>
            </div>
        </div>
        <div class="clear"></div>
        <div id="step_1" class="restInfo">
            <div class="box1">
                <span>账   户：</span>
                <input name="username" type="text" placeholder="用户名/邮箱/已验证手机号"/>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <span>验证码：</span>
                <input name="yzm" type="text" class="yzm"/>
                <img src="images/VerifyCode.jpg" width="100" height="35"/>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <input name="next1" type="button" step_index="1" class="onebtn" value="下一步"/>
            </div>
        </div>
        <div id="step_2" class="restInfo" hidden>
            <div class="box2" id="shoujihao">激活码已经发送到您的手机：152*******56 中</div>
            <div class="box1">
                <span>激活码：</span>
                <input name="jihuo" type="text" class="yzm"/>
                <b class="phonenum" id="huoqu">获取短信验证码</b>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <input name="next2" type="button" step_index="2" class="onebtn" value="下一步"/>
            </div>
        </div>
        <div id="step_3" class="restInfo" hidden>
            <div class="box2">
                <span class="span1">用户名：</span>
                <span class="span2" id="yhm">EB5_14@your_email.com</span>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <span>新密码：</span>
                <input name="new" type="text"/>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <span>确认密码：</span>
                <input name="new1" type="text"/>
                <div class="clear"></div>
            </div>
            <div class="box1">
                <input name="next3" type="button" step_index="3" class="onebtn" value="下一步"/>
            </div>
        </div>
        <div id="step_4" class="restInfo2" hidden>
            <div class="SucTitle">恭喜您，您的密码设置成功！</div>
            <p id="nihaoya">您的用户名是：HEB5_14@your_email.com</p>
            <p>您可以使用新密码登录蝶飞人才网<a href="login.html">立即登录</a></p>
        </div>

    </div>
</div>
<div class="clear"></div>
</body>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script>
    $(function () {
        $(".onebtn").on("click", function () {
            let stepIndex = $(this).attr("step_index");
            let stepId = '#step_' + stepIndex;
            stepIndex++;
            let divNextId = '#step_div_' + stepIndex;
            let stepNextId = '#step_' + stepIndex;
            $(stepId).hide();
            $(stepNextId).show();
            $(divNextId).addClass("Active");
        });
    });
</script>
</html>
